#pragma once

class CCursorIcon
{
public:
	CCursorIcon(void);
	~CCursorIcon(void);

	void init(HWND hWnd);
	void release();

	void setIconImageFromIntRasterData(JNIEnv*env,jintArray color, jbyteArray mask, jint widths, jint widthd, jint height);
	jobject createCursor(JNIEnv *env, jintArray color, jbyteArray mask, jint widths, jint widthd, jint height, jint x, jint y);
	void setCursor(JNIEnv*env,jobject o);
	void setCursorVisible(BOOL e);
	void onSetCursor(WORD hittest);
	void onShowCursor(BOOL e);

protected:
	static HICON createIcon(JNIEnv *env,HWND hWnd,jintArray color,jbyteArray mask,int widths,int widthd,int height,bool isCursor=false,int x=0,int y=0);
	static HBITMAP CreateDIBitmapFromBuf(HWND hWnd,DWORD* src,int widths,int widthd,int height);
	static HCURSOR GetSystemCursor(int t);

	HWND m_hWnd;
	HICON m_hIcon;
	HCURSOR m_hCursor;
	BOOL m_bCursorHide;
	BOOL m_bCursorHideLast;
};
